<template>
  <div>
    <el-table
      :data="tableNeedData.List">
      <el-table-column
        v-if="tableNeedData.tableColumnShow[0].flag"
        :label="tableNeedData.tableColumnShow[0].columnLabel"
        :class="tableNeedData.tableColumnShow[0].columnClass"
        type="index">
      </el-table-column>
      <el-table-column
        v-if="tableNeedData.tableColumnShow[1].flag"
        :label="tableNeedData.tableColumnShow[1].columnLabel"
        :class="tableNeedData.tableColumnShow[1].columnClass">
        <template slot-scope="scope">{{scope.row.id}}</template>
      </el-table-column>
      <el-table-column
        v-if="tableNeedData.tableColumnShow[2].flag"
        :label="tableNeedData.tableColumnShow[2].columnLabel"
        :class="tableNeedData.tableColumnShow[2].columnClass">
        <template slot-scope="scope">{{scope.row.email}}</template>
      </el-table-column>
      <el-table-column
        v-if="tableNeedData.tableColumnShow[3].flag"
        :label="tableNeedData.tableColumnShow[3].columnLabel"
        :class="tableNeedData.tableColumnShow[3].columnClass">
        <template slot-scope="scope">{{scope.row.phone}}</template>
      </el-table-column>
      <el-table-column
        v-if="tableNeedData.tableColumnShow[4].flag"
        :label="tableNeedData.tableColumnShow[4].columnLabel"
        :class="tableNeedData.tableColumnShow[4].columnClass">
        <template slot-scope="scope">{{scope.row.username}}</template>
      </el-table-column>
      <el-table-column
        v-if="tableNeedData.tableColumnShow[5].flag"
        :label="tableNeedData.tableColumnShow[5].columnLabel"
        :class="tableNeedData.tableColumnShow[5].columnClass">
        <template slot-scope="scope">{{scope.row.permission_group_title}}</template>
      </el-table-column>
      <el-table-column
        v-if="tableNeedData.tableColumnShow[6].flag"
        :label="tableNeedData.tableColumnShow[6].columnLabel"
        :class="tableNeedData.tableColumnShow[6].columnClass">
        <template slot-scope="scope">{{scope.row.role}}</template>
      </el-table-column>
      <el-table-column
        v-if="tableNeedData.tableColumnShow[7].flag"
        :label="tableNeedData.tableColumnShow[7].columnLabel"
        :class="tableNeedData.tableColumnShow[7].columnClass">
        <template slot-scope="scope">
            <!-- // 编辑按钮 -->
          <el-button type="primary" plain circle icon="el-icon-edit" @click="openDialog(scope.row)"></el-button>
            <!-- // 删除按钮 -->
          <el-button type="danger" plain circle icon="el-icon-delete"></el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { mapMutations } from 'vuex'
export default {
  props: ['tableNeedData'],
  data () {
    return {

    }
  },

  created () {

  },

  methods: {
    ...mapMutations(['openDialog'])
  }
}
</script>

<style scoped lang='less'>

</style>
